package com.tester.yaa.exam002.computeThread;

/**
 * @Aduthor yinanan
 * @ClassName ProducerThread
 * @Date 2022/12/11 20:01
 * @Description 资源线程（生产）
 **/
public class ProducerThread implements Runnable {

    private Resource resource1;

    public ProducerThread(Resource resource1){
        this.resource1 = resource1;
    }

    @Override
    public void run() {
        for (int i = 1; i <= 20; i++) {
            try {
                this.resource1.make();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
